<?php
class template_listing extends theme
{
	
	protected function head()
	{
	?>
<link type="text/css" rel="stylesheet" href="templates/pricing/css/listing.css">

<script type="text/javascript" language="javascript" src="templates/pricing/js/listing.js"></script>
	<?php
	}

	protected function center()
	{
		?>
<div class="center-title"><?php echo $this->title; ?></div>
<div class="center-content">

<div class="pricings">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr height="25">
	<th align="left">项目名</th>
	<th align="center" width="60">客户</th>
	<th align="center" width="70">报价工程师</th>
	<th align="center" width="110">报价时间</th>
	<th align="center" width="60">工期</th>
	<th align="center" width="200">费用</th>
</tr>

<?php
$pricings = $this->get('priced_pricings');

if(count($pricings))
{
$i=0;
foreach($pricings as $pricing)
{
?>
<tr height="25" class="row-<?php echo $i; ?>">
	<td align="left">
	<a href="<?php echo url('./?controller=pricing&task=detail&pricing_id='.$pricing->id.'&menu_id='.$this->get('menu_id') ); ?>" title="<?php echo $pricing->name; ?>" target="_blank">
	<?php echo $pricing->name; ?>
	</a>
	</td>
	<td align="center">
	<?php
	if($pricing->customer_id)
	{
		echo bone::get_user($pricing->customer_id)->name;
	}
	else
	{
		echo '游客';
	}
	?>
	</td>
	<td align="center">
	<?php
	$manager = bone::get_user($pricing->manager_id);
	?>
	<a href="<?php echo url('./?controller=team&task=user_detail&user_id='.$pricing->manager_id); ?>" title="<?php echo $manager->name; ?>" target="_blank">
	<?php echo $manager->name; ?>
	</a>
	</td>
	<td align="center"><?php echo date('Y-m-d',$pricing->price_time); ?></td>
	<td align="center"><?php echo $pricing->estimate_days; ?>天</td>
	<td align="center">
	<?php
	if($pricing->time_total>3600) echo intval($pricing->time_total/3600).'小时';
	if($pricing->time_total%3600!=0) echo intval($pricing->time_total%3600/60).'分钟';
	
	echo ' X '. $pricing->hourly_rate.'元/小时 =<span class="required">'.number_format($pricing->price, 2).'</span>元';
	?>	
	</td>
</tr>
<?php
$i = 1-$i;
}
}
else
{
?>
<tr height="25">
	<td colspan="6" align="center">暂无记录</td>
</tr>
<?php
}
?>
</table>
</div>

<p class="align-center"><?php $this->pagination(); ?></p>

</div>


		<?php
	}		
		

}
?>